import React,{Component} from 'react';
import {connect} from 'react-redux';
import {RecommendWrapper, RecommendItem} from '../style'

class Recommend extends Component{
  render() {
    return (
      <RecommendWrapper>
        {
          this.props.recommendList.map((item) => {
            return <RecommendItem url={item.get('url')} key={item.get('id')}/>
          })
        }
      </RecommendWrapper>
    )
  }
}

const mapStateToProps = (state) => ({
  recommendList: state.getIn(['home', 'recommendList'])
});

export default connect(mapStateToProps, null)(Recommend);